package cn.lzj.org.service.impl;

import cn.lzj.basic.service.impl.BaseServiceImpl;
import cn.lzj.org.domain.Employee;
import cn.lzj.org.mapper.EmployeeMapper;
import cn.lzj.org.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

//开启业务层的支持
@Service
//只读事务,全局默认是如果Bean调用事务就执行,如果没有就不用事务
@Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements IEmployeeService {
    @Autowired
    //注入mapper层
    private EmployeeMapper employeeMapper;


    @Override
    public List<Employee> list(Long shopId) {
        return employeeMapper.list(shopId);
    }
}
